<?php

enum Gender {
    case MAN;
    case WOMAN;
}

function gender(Gender $gender){
     echo match ($gender) {
         Gender::MAN => 1,
         Gender::WOMAN => 0,
         default => 2,
     };
}

gender(Gender::MAN);